home *** CD-ROM | disk | FTP | other *** search
/ Freelog 100 / FreelogNo100-NovembreDecembre2010.iso / ViePratique / Calendar Magic / setup.exe / {app} / ScreenCalc.shf < prev    next >
Text File  |  2007-01-06  |  1KB  |  64 lines

  1. Degrees
  2. ' Screen Attributes Calculator
  3. '
  4. ' Inputs
  5. '
  6. ' HRes = horizontal resolution
  7. ' VRes = vertical resolution
  8. ' Diag  = screen diagonal length
  9. '
  10. ' Outputs
  11. '
  12. ' NumPix = total number of pixels
  13. ' AspR = aspect ratio
  14. ' ScrW = screen width
  15. ' ScrH = screen height
  16. ' ScrArea = screen area
  17. ' PixPerInch = number of pixels per inch
  18. '
  19. ' First Screen
  20. '
  21. HRes1 = 800
  22. ==> HRes1 = 800
  23. VRes1 = 600
  24. ==> VRes1 = 600
  25. Diag1 = 5
  26. ==> Diag1 = 5
  27. NumPix1 = HRes1 * VRes1
  28. ==> NumPix1 = 480000
  29. AspR1 = int(100 * HRes1 / VRes1 + 0.499) / 100
  30. ==> AspR1 = 1.33
  31. Fac1 = sqrt(HRes1 ^ 2 + VRes1 ^ 2)
  32. ==> Fac1 = 1000
  33. ScrW1 = HRes1 * Diag1 / Fac1
  34. ==> ScrW1 = 4
  35. ScrH1 = VRes1 * Diag1 / Fac1
  36. ==> ScrH1 = 3
  37. ScrArea1 = ScrW1 * ScrH1
  38. ==> ScrArea1 = 12
  39. PixPerInch1 = int(HRes1 / ScrW1 + 0.499)
  40. ==> PixPerInch1 = 200
  41. '
  42. ' Second Screen
  43. '
  44. HRes2 = 1280
  45. ==> HRes2 = 1280
  46. VRes2 = 1024
  47. ==> VRes2 = 1024
  48. Diag2 = 19
  49. ==> Diag2 = 19
  50. NumPix2 = HRes2 * VRes2
  51. ==> NumPix2 = 1310720
  52. AspR2 = int(100 * HRes2 / VRes2 + 0.499) / 100
  53. ==> AspR2 = 1.25
  54. Fac2 = sqrt(HRes2 ^ 2 + VRes2 ^ 2)
  55. ==> Fac2 = 1639.1998047828
  56. ScrW2 = HRes2 * Diag2 / Fac2
  57. ==> ScrW2 = 14.836507379418
  58. ScrH2 = VRes2 * Diag2 / Fac2
  59. ==> ScrH2 = 11.869205903534
  60. ScrArea2 = ScrW2 * ScrH2
  61. ==> ScrArea2 = 176.09756097561
  62. PixPerInch2 = int(HRes2 / ScrW2 + 0.499)
  63. ==> PixPerInch2 = 86
  64.